export function formatBqName(bq) {
  if (/^1病区|^一病区/.test(bq)) {
    return '一病区'
  } else if (/^2病区|^二病区/.test(bq)) {
    return '二病区'
  } else if (/^3病区|^三病区/.test(bq)) {
    return '三病区'
  } else if (/^4病区|^四病区/.test(bq)) {
    return '四病区'
  } else if (/^5病区|^五病区/.test(bq)) {
    return '五病区'
  } else if (/^6病区|^六病区/.test(bq)) {
    return '六病区'
  } else if (/^7病区|^七病区/.test(bq)) {
    return '七病区'
  } else if (/^8病区|^八病区/.test(bq)) {
    return '八病区'
  } else if (/^9病区|^九病区/.test(bq)) {
    return '九病区'
  } else if (/^10病区|^十病区/.test(bq)) {
    return '十病区'
  } else if (/^11病区|^十一病区/.test(bq)) {
    return '十一病区'
  } else if (/^12病区|^十二病区/.test(bq)) {
    return '十二病区'
  } else if (/^13病区|^十三病区/.test(bq)) {
    return '十三病区'
  } else if (/^14病区|^十四病区/.test(bq)) {
    return '十四病区'
  } else if (/^15病区|^十五病区/.test(bq)) {
    return '十五病区'
  } else if (/^16病区|^十六病区/.test(bq)) {
    return '十六病区'
  } else if (/^17病区|^十七病区/.test(bq)) {
    return '十七病区'
  } else {
    return bq
  }
}

export function formatUserBqName(bq, bqTrees) {
  bqTrees = bqTrees || []
  const bqArray = []
  for (let i = 0; i < bqTrees.length; i++) {
    bqArray.push(bqTrees[i].deptName)
  }
  if (/^1病区|^一病区/.test(bq)) {
    return '一病区'
  } else if (/^2病区|^二病区/.test(bq)) {
    return '二病区'
  } else if (/^3病区|^三病区/.test(bq)) {
    return '三病区'
  } else if (/^4病区|^四病区/.test(bq)) {
    return '四病区'
  } else if (/^5病区|^五病区/.test(bq)) {
    return '五病区'
  } else if (/^6病区|^六病区/.test(bq)) {
    return '六病区'
  } else if (/^7病区|^七病区/.test(bq)) {
    return '七病区'
  } else if (/^8病区|^八病区/.test(bq)) {
    return '八病区'
  } else if (/^9病区|^九病区/.test(bq)) {
    return '九病区'
  } else if (/^10病区|^十病区/.test(bq)) {
    return '十病区'
  } else if (/^11病区|^十一病区/.test(bq)) {
    return '十一病区'
  } else if (/^12病区|^十二病区/.test(bq)) {
    return '十二病区'
  } else if (/^13病区|^十三病区/.test(bq)) {
    return '十三病区'
  } else if (/^14病区|^十四病区/.test(bq)) {
    return '十四病区'
  } else if (/^15病区|^十五病区/.test(bq)) {
    return '十五病区'
  } else if (/^16病区|^十六病区/.test(bq)) {
    return '十六病区'
  } else if (/^17病区|^十七病区/.test(bq)) {
    return '十七病区'
  } else {
    if (bqArray.indexOf(bq) != -1) {
      return bq
    } else {
      return ''
    }
  }
}
